Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The previous
VRMLLoader
has produced many issues in the past because of it's line-by-line parsing approach. AlthoughVRML
is a very old 3D standard, it has still some significance in various areas like the scientific community. Because of this, I've decided to implement a newVRMLLoader
from scratch.The new loader use as lexer + parser built with chevrotain to convert the VRML into a JSON representation. In the next step, the loader builds a
three.js
scene similar to the previous one. So the loader is backwards-compatible but it's necessary to include the chevrotain lib in your code. However, this dependency ofVRMLLoader
will not be noticeable anymore with the JSM version in the future.Using a lexer/parser approach makes the loader more robust and allows to retain the actual semantic of the VRML tree. Because of this,
VRMLLoader
can now handle more files than before.The PR also added support for points, lines, textures, texture transforms and computes normals now according to the VRML standard. I've also created a new directory with some VRML test files that I've used to verify the correctness. But you can also see the difference with the official example.
If you closely compare the geometries of the house, you will see a noticeable improvement and a more consistent result compared to other viewers (e.g. Sketchfab).
This PR closes: #8282, #14814, #15725, #15281